<form id="SecUserGroupForm" method="post">
    <div class="form-group col-md-12">
        <label class="col-md-2" for="roleSelect">角色</label>
        <div class="col-md-10 col-md-offset-2">
            <select class="selectpicker" id="roleSelect" name="gids" multiple="multiple">
                <th:block th:each="group : ${groups}">
                    <option th:if="${#lists.contains(gids,group.gid)}" th:value="${group.gid}" th:text="${group.groupName}" selected="selected"></option>
                    <option th:if="${not #lists.contains(gids,group.gid)}" th:value="${group.gid}" th:text="${group.groupName}"></option>
                </th:block>
            </select>
            <input type="hidden" name="uid" th:value="${user.uid}"/>
        </div>
    </div>
    <div class="form-group text-right dialog-buttons">
        <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
        <button class="waves-effect waves-button" id="btn-SecUser-group"><i class="fa fa-save"></i>保存</button>
        <a class="waves-effect waves-button" href="javascript:;" data-dismiss="modal"><i class="fa fa-close"></i> 关闭</a>
    </div>
</form>